<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>店铺进货列表</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        $(document).ready(function() {
        });
        function page(n,s) {
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").attr("action","${ctx}/sys/order/allOrder/${flag}");
            $("#searchForm").submit();
            return false;
        }
    </script>
</head>
<body>
<ul class="nav nav-tabs">
    <li class="active"><a href="${ctx}/sys/orderProduct/orderProductList">店铺进货列表</a></li>
</ul>
<form:form id="searchForm" modelAttribute="tbOrder" action="${ctx}/sys/order/allOrder/${flag}" method="post" class="breadcrumb form-search">
    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
            <li><label>交易订单号：</label>
                <input type="text" name="orderNo" value="${tbOrder.orderNo}" htmlEscape="false" maxlength="50" class="input-medium"/>
            </li>
            <li><label>交易用户：</label>
                <input type="text" name="contactName" value="${tbOrder.contactName}" htmlEscape="false" maxlength="50" class="input-medium"/>
            </li>
           <c:if test="${flag==3}">
               <li><label>交易门店：</label>
                   <input type="text" name="userName" value="${tbOrder.userName}" htmlEscape="false" maxlength="50" class="input-medium"/>
               </li>
           </c:if>
            <c:if test="${flag==4}">
                <li><label>交易门店：</label>
                    <input type="text" name="userName" value="${tbOrder.userName}" htmlEscape="false" maxlength="50" class="input-medium"/>
                </li>
            </c:if>
            <li><label>派送状态：</label>
                <select id="box" name="delivery" class="input-medium">
                    <option  value="">全部</option>
                    <option  value="0" <c:if test="${tbOrder.delivery=='0'}">selected</c:if> >派送中</option>
                    <option  value="1" <c:if test="${tbOrder.delivery=='1'}">selected</c:if>>派送完成</option>
                </select>
            </li>
            <li><label>支付类型：</label>
                <select id="box1" name="payId" class="input-medium">
                    <option value="">全部</option>
                    <option  value="1" <c:if test="${tbOrder.payId=='1'}">selected</c:if> >物业钱包</option>
                    <option  value="2" <c:if test="${tbOrder.payId=='2'}">selected</c:if>>麻雀钱包</option>
                    <option  value="3" <c:if test="${tbOrder.payId=='3'}">selected</c:if>>微信</option>
                    <option  value="5" <c:if test="${tbOrder.payId=='5'}">selected</c:if>>现金</option>
                    <option  value="6" <c:if test="${tbOrder.payId=='6'}">selected</c:if>>银行卡</option>
                </select>
            </li>
            <li><label>付款类型：</label>
                <select id="box2" name="payState" class="input-medium">
                    <option value="">全部</option>
                    <option  value="0" <c:if test="${tbOrder.payState=='0'}">selected</c:if> >未支付</option>
                    <option  value="1" <c:if test="${tbOrder.payState=='1'}">selected</c:if>>已支付</option>
                </select>
            </li>
    <br/><br/>
            <c:if test="${flag==4}">
                <li><label>是否线下售货：</label>
                    <select id="box3" name="delivery" class="input-medium">
                        <option  value="">全部</option>
                        <option  value="0" <c:if test="${tbOrder.delivery=='0'}">selected</c:if> >派送中</option>
                        <option  value="1" <c:if test="${tbOrder.delivery=='1'}">selected</c:if>>派送完成</option>
                    </select>
                </li>
            </c:if>
            <li><label>日期范围：&nbsp;</label>
                <input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate" value="${tbuserverify.beginDate}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
                --&nbsp;<input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
                               value="${tbuserverify.endDate}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>&nbsp;&nbsp;
            </li>
            <li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
            <li class="clearfix"></li>
        </ul>
    </div>
</form:form>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
    <th>进货订单号</th>
    <th>交易用户</th>
    <c:if test="${flag==4}">
        <th>交易门店</th>
    </c:if>
    <c:if test="${flag==3}">
        <th>交易门店</th>
    </c:if>
    <th>交易金额</th>
    <th>派送状态</th>
    <th>订单状态</th>
    <th>支付类型</th>
    <th>付款状态</th>
    <th>下单时间</th>
    <th>完成时间</th>
   <%-- <c:if test="${flag==4}">
        <th>是否线下售货</th>
    </c:if>--%>
    </thead>
    <tbody>
        <c:forEach items="${page.list}" var="tbOrder">
            <tr>
                <td>${tbOrder.orderNo}</td>
                <td>${tbOrder.contactName}</td>
                <c:if test="${flag==3}">
                    <td>${tbOrder.userName}</td>
                </c:if>
                <c:if test="${flag==4}">
                    <td>${tbOrder.userName}</td>
                </c:if>
                <td>${tbOrder.orderAmount}</td>
                <td>
                <c:choose>
                    <c:when test="${tbOrder.delivery eq '0'}">
                        派送中
                    </c:when>
                    <c:when test="${tbOrder.delivery eq '1'}">
                        派送完成
                    </c:when>
                    <c:otherwise>
                        未派送
                    </c:otherwise>
                </c:choose>
            </td>
                <td>
                    <c:if test="${tbOrder.orderState eq '0'}">
                        未确认（未支付）
                    </c:if>
                    <c:if test="${tbOrder.orderState eq '1'}">
                        已确认(已支付)
                    </c:if>
                    <c:if test="${tbOrder.orderState eq '2'}">
                        待发货
                    </c:if>
                    <c:if test="${tbOrder.orderState eq '3'}">
                        已发货
                    </c:if>
                    <c:if test="${tbOrder.orderState eq '4'}">
                        已完成
                    </c:if>
                    <c:if test="${tbOrder.orderState eq '5'}">
                        已取消
                    </c:if>
                    <c:if test="${tbOrder.orderState eq '6'}">
                        已关闭
                    </c:if>
                </td>
                <td>
                    <c:choose>
                        <c:when test="${tbOrder.payId eq '1'}">
                            物业钱包
                        </c:when>
                        <c:when test="${tbOrder.payId eq '2'}">
                            麻雀钱包
                        </c:when>
                        <c:when test="${tbOrder.payId eq '3'}">
                            微信
                        </c:when>
                        <c:when test="${tbOrder.payId eq '5'}">
                            现金
                        </c:when>
                        <c:when test="${tbOrder.payId eq '6'}">
                            银行卡
                        </c:when>
                    </c:choose>
                </td>
                <td>
                    <c:if test="${tbOrder.payState eq '0'}">
                        未确认（未支付）
                    </c:if>
                    <c:if test="${tbOrder.payState eq '1'}">
                        已确认(已支付)
                    </c:if>
                </td>
                <td><fmt:formatDate value="${tbOrder.createTime}" type="both"/></td>
                <td><fmt:formatDate value="${tbOrder.payTime}" type="both"/></td>
            </tr>
        </c:forEach>
    </tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>